package org.lyp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import org.lyp.dao.MemberDao;
import org.lyp.vo.Member;
import org.lyp.service.MemberService;
/**
 * 客户业务实现类
 * @author DCJ
 *
 */
@Service
public class MemberServiceImpl implements MemberService {
	@Autowired
	private MemberDao memberDao;

	@Override
	public void saveMember(Member member) {
		memberDao.save(member);
		
	}
	@Override
	public void updateMember(Member member) {
		memberDao.update(member);
		
	}
	@Override
	public void deleteMember(int Member) {
		Member member = memberDao.get(Member);
		memberDao.delete(member);
	}

	@Override
	public List<Member> findAllMember(int page, int rows, String sort, String order) {
		return memberDao.findAll(page, rows, sort, order);
	}

	@Override
	public int getTotal() {
		return memberDao.countAll();
	}
	@Override
	public boolean isExist(String MemID) {
		boolean flag = false;
		String hql="from memberinfo as c where c.MemID="+MemID;
		if (memberDao.find(hql).size()>0){
			flag = true;
		}
		return flag;
	}
}
